﻿using System;

namespace Relay.Core.Sockets {
    public class TcpSocketConnectFailedEventArgs : EventArgs {
        private Exception _innerException = null;

        public Exception InnerException {
            get { return _innerException; }
            set { _innerException = value; }
        }

        public TcpSocketConnectFailedEventArgs(Exception innerException) {
            _innerException = innerException;
        }
    }

    public class TcpSocketDataReceievedEventArgs : EventArgs {
        private byte[] _data = null;
        private int _bytesReceieved = 0;

        public byte[] Data {
            get { return _data; }
            set { _data = value; }
        }
        public int BytesReceieved {
            get { return _bytesReceieved; }
            set { _bytesReceieved = value; }
        }

        public TcpSocketDataReceievedEventArgs(byte[] data, int bytesReceieved) {
            _data = data;
            _bytesReceieved = bytesReceieved;
        }
    }

    public class TcpSocketDisconnectedEventArgs : EventArgs {
        private TcpSocketDisconnect _reason = TcpSocketDisconnect.Unknown;

        public TcpSocketDisconnect Reason {
            get { return _reason; }
            set { _reason = value; }
        }

        public TcpSocketDisconnectedEventArgs(TcpSocketDisconnect reason) {
            _reason = reason;
        }
    }
}
